/*
 * @Descripttion: 期末记账
 * @version: V1.0
 * @Author: GaoWei
 * @Date: 2021-04-25 12:11:55
 * @LastEditors: GW
 * @LastEditTime: 2022-05-31 14:55:49
 */
import { axios } from "../../utils/request";
// 会计期间
const api = {
    list: "/erp/period/list",   //获取当前 租户的 会计期间
    deleteLastYear: "/erp/period/deleteLastYear",   //删除最后一年
    save: "/erp/period/save",   //保存 会计期间

    settle: "/erp/period/settleAccounts",   //财务 期末记账
    settleyear: "/erp/period/settleYearAccounts", //结转下年

    getSettleListUrl:"/erp/settleAccounts/getSettleAccountsList",//获取结帐列表
 
    postSettleSave:"/erp/settleAccounts/postSettleSave",//进销存结帐
}
/**
 * 列表
 */
export function list(parameter) {
    return axios({
        url: api.list,
        method: "get",
        params: parameter
    });
}

/**
 * 保存
 */
export function save(parameter) {
    return axios({
        url: api.save,
        method: "post",
        data: parameter
    });
}

/**
 * 删除
 */
export function deleteLastYear(parameter) {
    return axios({
        url: api.deleteLastYear,
        method: "delete",
        params: parameter
    });
}

/**
 * 期末结账
 */
export function endSettle(parameter) {
    return axios({
        url: api.settle,
        method: "get",
        params: parameter
    });
}

//结转下年
export function settleYear(parameter) {
    return axios({
        url: api.settleyear,
        method: "get",
        params: parameter
    });
}

/**
 * 获取结帐列表
 */
 export function getSettleList(parameter) {
    return axios({
        url: api.getSettleListUrl,
        method: "get",
        params: parameter
    });
}


/**
 * 业务结账
 */
 export function postSettleSave(parameter) {
    return axios({
        url: api.postSettleSave,
        method: "post",
        data: parameter
    });
}
